﻿@model MVCTutorial.GUI.Web.ViewModels.UserSkills

@{
    ViewBag.Title = "Edição";
}

<h2>Edição</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) 
{
    
	@Html.ValidationSummary(true)
    
	<fieldset>
        
		<legend>Edição de Usuário</legend>

        @Html.HiddenFor(model => model.Id)

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>
		<div class="editor-label">
            @Html.LabelFor(model => model.Skills)
        </div>
		<div class="editor-field">
			@Html.ListBoxFor(m => m.SkillIds, new MultiSelectList(ViewBag.Skills, "Id", "Description"))
        </div>

        <p>
            <input type="submit" value="Salvar" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Listagem de Usuários", "Index")
</div>
